using System;
using IFXplus.Northwind;
using IFXplus.SmartStorage;

namespace IFXplus.Northwind
{
    public class CustomerCache : BaseStorageManager<Customer>
    {
        public static StorageItemMetadata GetMetadata(string customerId)
        {
            StorageItemMetadata metadata = new StorageItemMetadata();

            metadata.BaseKey = typeof(Customer).FullName;
            metadata.AddKeyParameter("CustomerId", customerId);

            metadata.AbsoluteTTL = new TimeSpan(0, 0, 10, 0, 0);

            //metadata.AddProvider("ASPNET", StorageProviderType.AspNetCache);
            //metadata.AddProvider("FS", StorageProviderType.FileSystem);
            //metadata.AddProvider("MEM", StorageProviderType.Memory);
            metadata.AddProvider("WS", StorageProviderType.WebService);
            //metadata.AddProvider("SqlServer", StorageProviderType.SqlServer);

            return metadata;
        }
    }
}